package com.casic.ops.entity.vo;

import com.casic.ops.entity.dto.StatisticsCountDTO;
import com.orion.utils.convert.TypeStore;
import lombok.Data;

/**
 * @ClassName ops-platform
 * @Description  首页统计数量返回
 * @Author mianbin
 * @Date 2022/5/31 10:59
 * @Version 1.0
 **/
@Data
public class HomeStatisticsCountVO {

    /**
     * 机器数量
     */
    private Integer machineCount;

    /**
     * 环境数量
     */
    private Integer profileCount;

    /**
     * 应用数量
     */
    private Integer appCount;

    /**
     * 日志数量
     */
    private Integer logCount;

    public static HomeStatisticsCountVO statisticsCountDTO2homeStatisticsCountVO(StatisticsCountDTO p) {
        HomeStatisticsCountVO vo = new HomeStatisticsCountVO();
        vo.setMachineCount(p.getMachineCount());
        vo.setProfileCount(p.getProfileCount());
        vo.setAppCount(p.getAppCount());
        vo.setLogCount(p.getLogCount());
        return vo;
    }

    static {
        TypeStore.STORE.register(StatisticsCountDTO.class, HomeStatisticsCountVO.class, p -> {
            HomeStatisticsCountVO vo = new HomeStatisticsCountVO();
            vo.setMachineCount(p.getMachineCount());
            vo.setProfileCount(p.getProfileCount());
            vo.setAppCount(p.getAppCount());
            vo.setLogCount(p.getLogCount());
            return vo;
        });
    }


}
